<!-- 组件风格 -->
<template>
    <template v-if="['picture', 'album', 'list'].includes(widgetType) && !widget.parentId">
        <picture-mode :widget="widget" />
    </template>
    <template v-else-if="['suspension', 'new-suspension'].includes(widgetType)">
        <suspension-mode :widget="widget" />
    </template>
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
import PictureMode from './components/picture-mode'
import SuspensionMode from './components/suspension-mode'
export default defineComponent({
    name: 'RowComponentMode',
    components: {
        PictureMode,
        SuspensionMode
    },
    props: {
        widget: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { widget } = toRefs(props)

        const widgetType = computed(() => widget.value?.widgetData?.eles?.type)

        return {
            widget,
            widgetType
        }
    }
})
</script>